python code for sqlite